package yunquan.wang.modules.customer.web;

import javax.annotation.Resource;
import javax.validation.Valid;

import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import yunquan.wang.base.service.BaseService;
import yunquan.wang.base.web.BaseController;
import yunquan.wang.modules.customer.entity.Customer;
import yunquan.wang.modules.customer.service.CustomerService;

@Controller
@RequestMapping("/customer/customer")
public class CustomerController  extends BaseController< Customer> {
	@Resource
	private CustomerService service;
	@RequestMapping(value = "/list.do")
	public ModelAndView list() {
		return baseList();
	}
	
	@RequestMapping(value = "/save.do")
	public ModelAndView save(@Valid Customer entity,
			BindingResult bindingResult) {
		return baseSave(entity,bindingResult);
	}
	 
	@RequestMapping(value = "/view.do")
	public ModelAndView view() {
		return baseView();
	}
	 
	@RequestMapping(value = "/input.do")
	protected ModelAndView input() {
		return baseInput();
	}
	 
	@RequestMapping(value = "/delete.do")
	protected  ModelAndView delete() {
		return baseDelete();
	}

	@Override
	public BaseService<Customer> getService() {
		return service;
	}
}
